package com.sangmo.fts.teacher.calculator;

import com.sangmo.boot.framework.data.json.context.KeyValue;
import com.sangmo.boot.framework.data.json.load.Calculator;
import com.sangmo.fts.teacher.model.Examination;

import java.util.Collection;

public class ExaminationProcessStateCalculator implements Calculator<Examination>, Examination.IProcessStateCalculator {
    @Override
    public Object calc(Examination bean, Collection<KeyValue> exts) {
        long currentMillis = System.currentTimeMillis();
        if (null != bean && currentMillis > bean.getEndTime().getTime()) {
            return "已结束";
        } else if (currentMillis < bean.getStartTime().getTime()) {
            return "未开始";
        } else {
            return "进行中";
        }
    }
}
